package com.ray.friendslist.request;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

import com.ray.friendslist.ContextHolder;

abstract class LoginRequest {
	private long mClientID;
	private String mRedirectedUri;
	private String mDisplay;
	private String mScope;
	private String mResponceType;
	private String mLoginRequest;
	private static Editor mEditor;
	private static SharedPreferences mPrefs;
	public static final String AUTHORISED="AUTHORISED";

	//abstract String getResponse();
	
	public long getClientId(){
		return this.mClientID;
	}
	
	public static boolean isAuthorised() {
		mPrefs = PreferenceManager.getDefaultSharedPreferences(ContextHolder.getInstance().getContext());
		boolean result=false;
		return mPrefs.getBoolean(AUTHORISED, result);
	}

	public static void setAuthorised(boolean authorised) {
		mPrefs = PreferenceManager.getDefaultSharedPreferences(ContextHolder.getInstance().getContext());
		mEditor = mPrefs.edit();
		mEditor.putBoolean(AUTHORISED,authorised);
		mEditor.commit();
	}
	
	public String getRedirectedUri(){
		return this.mRedirectedUri;
	}
	
	public String getDisplay(){
		return this.mDisplay;
	}
	
	public String getScope(){
		return this.mScope;
	}
	
	public String getResponceType(){
		return this.mResponceType;
	}
	
	public String getLoginRequest(){
		return this.mLoginRequest;
	}
	
	public void setClientId(long value){
		this.mClientID=value;
	}
	
	public void setRedirectedUri(String value){
		this.mRedirectedUri=value;
	}
	
	public void setDisplay(String value){
		this.mDisplay=value;
	}
	
	public void setScope(String value){
		this.mScope=value;
	}
	
	public void setResponceType(String value){
		this.mResponceType=value;
	}
	
	public void setLoginRequest(String value){
		this.mLoginRequest=value;
	}
}
